import { post , upload } from './http'


// 获取笔记列表
export const getNoteList = async (data,fun) => await post('获取笔记列表','note/list',data,fun)

// 根据标签获取笔记列表
export const getTagNoteList = async (data,fun) => await post('获取标签笔记列表','note/taglist',data,fun)

// 根据分类获取笔记列表
export const getTypeNoteList = async (data,fun) => await post('获取分类笔记列表','note/typelist',data,fun)

// 获取分享列表
export const getNoteShareList = async (data,fun) => await post('获取笔记分享列表','note/sharelist',data,fun)

// 删除分享
export const deleteNoteShare = async (data,fun) => await post('删除笔记分享','note/delshare',data,fun)

// 删除笔记
export const deleteNote = async (data,fun) => await post('删除笔记','note/delnote',data,fun)

// 笔记分类列表
export const noteTypeList = async (data,fun) => await post('获取笔记分类','note/type',data,fun)

// 笔记详情
export const detailsNote = async (id) => await post('查看笔记详情','note/details',{id:id})

// 分享笔记详情
export const getNoteShare = async (data) => await post('查看笔记分享','note/detailsshare',data)

// 创建分享
export const addNoteShare = async (data,fun) => await post('创建笔记分享','note/addnoteshare',data,fun)

// 发布笔记
export const noteAdd = async (data,fun) => await post('发布笔记','note/noteadd',data,fun)

// 修改笔记
export const noteEdit = async (data,fun) => await post('修改笔记','note/noteedit',data,fun)

// 删除笔记中的账号
export const deleteNoteUser = async (id,fun) => await post('删除账号','note/deleteuser',{id:id},fun)

// 登录账号
export const postLogin = async (data,fun) => await post('登录账号','user/login',data,fun)

// 微信小程序：微信登录
export const WeChatAppLogin = async (data,fun) => await post('登录账号','wechat/login',data,fun)

// 退出登录
export const postLogout = async (data,fun) => await post('退出登录','user/logout',data,fun)

// 查询统计数据
export const getCountNoteNums = async (data,fun) => await post('统计数据','user/getcountnote',data,fun)

// 完善资料
export const profile = async (data,fun) => await post('完善资料','user/profile',data,fun)

// 获取配置文件
export const getConfig = async (data,fun) => await post('配置资料','index/config',data,fun)

// 上传
export const uploadFileHead = async (data,file) => await upload('user/upload',data,file)